package com.yhb.utils;

import me.edzh.spring.bootstrap.processor.SignAndEncryptProcessor;
import me.edzh.spring.bootstrap.utils.security.RSAUtils;
import org.springframework.stereotype.Service;

import java.security.PrivateKey;
import java.security.PublicKey;

@Service
public class EncryptConfig implements SignAndEncryptProcessor.EncryptConfig {
    private static final PrivateKey privateKey = RSAUtils.getPrivateKey("MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCIW4g3uWSFm45ErBgJ1rggrEcjVCbbbuG4zUZw/569Z2vPHtpF2p652xCjTXBbNFuLXU+7WQ8lkl4XTGs22EBZPCqXMby9ZHNPOHs1UUBm90zJ7Rvzxpxc7EaeGd09tLfM38g6bKpEkGZzQCiF816Oir1eeH8P+PHO7PQJWWAror1n5/P+6CLyhBMy+BRpEq5azFsItA+D4w4olRCMSvjZ0SX0uV00QMZoDu0+qUTxOjQ31cCXMj7wzCe1+WtQKLHEE8xgSCbqSx8YDoAwrDCF8kuUnaJxbV1bpYs6rVUrETPfTvqn3sGOtVMA2igriOgdHg7lLCHiutQVSKyZ8DNTAgMBAAECggEAezhzzR9slkwu8SGvC10MwQHNu0A1aQA3XD+sEzr74N7PjriruIpJ+1vaGihFizWyMCtffMaLKIGvI1C8ZjBfXgQ/3KdmjqNyjDlXJaRKFYIO0z7AjreA33voiMCIrFVd7vaewyUlbJYs7qMgu4NkhF0dqXwsHmvxX/PCx5wLiwHD9zg9ebhh+3zeqkeJzrrPT6wYt5PmYYgzd+X/2dGRUS8MX141sAV3q1mgFkruVCpN/fsyzMd7hbV6wzUUIOW/FMsOQ89+P7IuOmSYS7nsEDGc5gj9L4vK3bOOo580EJr7HEeQHDEC/gTDUDZ7bUj+/u1g7qp+cBOb5Ih0W7rf0QKBgQD1O81mHJb/RejH07UAoqw3gjYx5iO+WlR6TkA+fuSdO/Znd4vrHPN3cx9Lu2HRgdvHhkoI6ghWPHufJ5rVt+S6Pu+d3Lk8MvVNI6CL4JgE4fy4dy5ENPqzwP6+f29YUF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YEgm6ksfGA6AMKwwhfJLlJ2icW1dW6WLOq1VKxEz3076p97BjrVTANooK4joHR4O5Swh4rrUFUismfAzUwIDAQAB");

    @Override
    public PrivateKey privateKey() {
        return privateKey;
    }

    public static PublicKey publicKey() {
        return publicKey;
    }

}
